{extend name="layout/layout"}
{block name="content"}

<main class="details">
    <section style="padding: 0.3rem;">
        <div class="layui-main">
            <span class="layui-breadcrumb mb30" lay-separator=">">
               <a href="/">主页 </a>
               <a href="#">新手教学</a>
               <a href="#">{$detail.title}</a>
            </span>
            <div class="d-flex mt30">
                <div class="flex-1 details_b1">
<!--                    文章-->
                    <div class="d_content w100">
                        <h1 class="title" style="text-align: center;font-size: 1.3em;padding:10px;">{$detail.title}</h1>
                        <div class="subtitle" style="text-align: center;font-size: 0.9em;opacity: 0.8">{$detail.subtitle}</div>
                        <p style="margin-top:20px;">{$detail.content|raw}</p>
                    </div>
                   
                    <!-- <p style="margin-top:20px;display: flex;justify-content: flex-end">
                        <a href="/activity/detail/{$detail.activity_id}.html" style="color: #F97A28;">去参加>>></a>
                    </p> -->
                    <p style="display: flex;justify-content: center;margin-top:20px;">
                        <img src="{$detail.logo}" alt="" style="border-radius: 10px;">
                    </p>

                 
                    <a href="/activity/create/agreement.html" style="color: #F97A28;float:right">去创建>>></a>
<!--                    喜欢-->
                    <div class="mt60 ">
                        {notempty name="like"}
                        <div class="w50 title1 mb30">
                            <fieldset class="layui-elem-field layui-field-title">
                                <legend class="ft20">或許你會喜歡</legend>
                            </fieldset>
                        </div>
                        <ul class="layui-row layui-col-space30 ul_height">
                            {foreach $like as $likeItem}
                            <li class="layui-col-md4 layui-col-xs6">
                                <a href="/detail/{$likeItem.id}.html" class="item">
                                    <div class="img_100" style="height: 1.9rem;">
                                        <img src="{$likeItem.logo}">
                                    </div>
                                    <p class="layui-elip mt19">{$likeItem.title|default='-'}</p>
                                </a>
                            </li>
                            {/foreach}
                        </ul>
                        {/notempty}
                        <div class="w50 title1 mt60  mb40">
                            <fieldset class="layui-elem-field layui-field-title">
                                <legend class="ft20">分享你的看法</legend>
                            </fieldset>
                        </div>
                      
                        <form class="layui-form d_form" onsubmit="return false;">
                            <div class="layui-form-item mb34">
                               <textarea type="text" name="content" lay-verify="required" placeholder="请输入您的看法..."
                                  autocomplete="off" class="layui-textarea"></textarea>
                            </div>
                            <div class="layui-form-item d-flex">
                               <input type="text" name="name" lay-verify="required" placeholder="名称" autocomplete="off"
                                  class="layui-input mr50" placeholder="">
                               <input type="text" name="email" lay-verify="required|email" placeholder="邮箱" autocomplete="off"
                                  class="layui-input">
                            </div>
                            <div class="mt40 flex-center">
                               <button class="layui-btn layui-bg-orange" lay-submit lay-filter="comment">　　发送　　</button>
                            </div>
                         </form>
                    </div>
                </div>
                <div class="details_b2 layui-hide-xs ml50">
                    {notempty name="hot"}
                    <div class="item">
                        <p class="t1">热门文章</p>
                        <ul class="layui-row ul_height d_ul1">
                            {foreach $hot as $hotItem}
                            <li class="layui-col-md12 layui-col-xs12">
                                <a href="/detail/{$hotItem.id}.html" class="item">
                                    <div class="img_box">
                                        <img src="{$hotItem.logo}">
                                    </div>
                                    <div class="line-clamp3 ft15 line17">{$hotItem.title|default='-'}</div>
                                </a>
                            </li>
                            {/foreach}
                        </ul>
                    </div>
                    {/notempty}

                    {notempty name="newest"}
                    <div class="item">
                        <p class="t1">最新文章</p>
                        <ul class="layui-row ul_height d_ul1">
                            {foreach $newest as $newestItem}
                            <li class="layui-col-md12 layui-col-xs12">
                                <a href="/detail/{$newestItem.id}.html" class="item">
                                    <div class="img_box">
                                        <img src="{$newestItem.logo}">
                                    </div>
                                    <div class="line-clamp3 ft15 line17">{$newestItem.title|default='-'}</div>
                                </a>
                            </li>
                            {/foreach}
                        </ul>
                    </div>
                    {/notempty}
                </div>
            </div>
        </div>
    </section>
    <script>
        layui.use('form', function(){
            var form = layui.form;
            //提交
            form.on('submit(comment)', function(data){
                $.quickPost('/detail/{$detail.id}/comment',data.field).done(function (){
                    location.reload()
                });
                return false;
            });
            });
    </script>
</main>
{/block}
